<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Kowcore
 * @copyright  Copyright KEENONWEB LLC
 * @license    http://www.keenonweb.com/
 * @version    $Id: Controller.php 2011-03-09 08:45:41Z idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Kowcore
 * @copyright  Copyright KEENONWEB LLC
 * @license    http://www.keenonweb.com/
 */

class Kowcore_Widget_TagCloudController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
    if (!Engine_Api::_()->core()->hasSubject()) {
      $this->setNoRender();
      return ;
    }

    $subject = Engine_Api::_()->core()->getSubject();
    $this->view->tags = $tags = Engine_Api::_()->kowcore()->getTagCloud($subject);
    
    if (empty($tags)) {
      return $this->setNoRender();
    }
  }
}